package com.molichuxing.job;

import com.molichuxing.service.OrderJobService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 *  op 商家订单未还款预警  采购订单还款逾期后1天触发
 */
@JobHandler(value = "orderDealerOverdueReminderToServiceHandle")
@Component
public class OrderDealerOverdueReminderToServiceHandle extends IJobHandler {
	private static final Logger logger = LoggerFactory.getLogger(OrderDealerOverdueReminderToServiceHandle.class);

	@Resource
	private OrderJobService orderJobService;

	public OrderDealerOverdueReminderToServiceHandle() {
        super();
    }

	@Override
	public void init() {
		super.init();
	}

	@Override
	public void destroy() {
		super.destroy();
	}

	@Override
	public ReturnT<String> execute(String param) throws Exception {
		ReturnT<String> returnT = ReturnT.SUCCESS;
		logger.info("==============给用户发送各种提醒定时任务start================");
		try {
			//
			orderJobService.orderDealerOverdueReminderToServicer();
		} catch (Exception e) {
			// TODO: handle exception
		}
		logger.info("==============给用户发送各种提醒定时任务end================");
		return returnT;
	}

}
